import request from '/@/utils/request';
import { Session } from '/@/utils/storage';
/**
 * 无人机影像云 -- 登录
 * @returns
 */
export function uavLogin() {
	return request({
		url: '/api/userAuthentication/cloudOuterLogin',
		params: {
			tenantId: '39',
			appCode: 'e'
		},
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded',
		},
	});
}
/**
 * 无人机影像云 -- 刷新token
 * @returns
 */
export function uavRefreshToken() {
	let refreshToken = Session.get('uav_access_token');
	let params = {
		refreshToken,
	};
	return request({
		url: '/api/userAuthentication/cloudRefreshToken',
		params,
	});
}

/**
 * 无人机影像云 -- 获取影像时间列表
 * @param {*} data
 * @returns
 */
export function getUavImgTimeList(data) {
	const accessToken = Session.get("uav_access_token");
	return request({
		url: `/api/openApi/getTiffDate`,
		method: 'post',
		data,
		headers: {
			accessToken,
		},
	});
}
/**
 * 无人机影像云 -- 获取影像列表
 * @param {*} data
 * @returns
 */
export function getUavImageLayerList(data) {
	const accessToken = Session.get("uav_access_token");
	return request({
		url: `/api/openApi/getTiffDataList`,
		method: 'post',
		data,
		headers: {
			accessToken,
		},
	});
}
/**
 * 无人机影像云 -- 获取区域列表
 * @param {*} data
 * @returns
 */
export function getUavRegionList(data) {
	const accessToken = Session.get("uav_access_token");
	return request({
		url: `/api/openApi/getRegionList`,
		method: 'post',
		data,
		headers: {
			accessToken,
		},
	});
}
/**
 * 无人机影像云 -- 获取影像标签
 * @param {*} data
 * @returns
 */
export function getImageTagList(data) {
	const accessToken = Session.get("uav_access_token");
	return request({
		url: `api/openApi/getTagList`,
		method: 'post',
		data,
		headers: {
			accessToken,
		},
	});
}
